# 方法一 
class Solution:
    def largestPerimeter(self, nums: List[int]) -> int:
        nums.sort(reverse = True)
        
        i, j, k = 0, 1, 2
        while k < len(nums):
            c = nums[i] + nums[j] + nums[k]
            if nums[i] < nums[j] + nums[k]:
                return c 
            else:
                i += 1
                j += 1
                k += 1
        return 0